package me.yushuai.wukong.base.convertor;

import me.yushuai.wukong.base.api.dto.CreateLotDef;
import me.yushuai.wukong.base.api.dto.LotAttr;
import me.yushuai.wukong.base.entity.LotAttrDef;
import me.yushuai.wukong.base.entity.LotDef;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

/**
 * @author zhoushuai@189.cn
 * @since 2023-03-01
 */
@Mapper(componentModel = "spring")
public interface LotDefConvertor {

    @Mapping(target = "notes", ignore = true)
    @Mapping(target = "lotAttrDefs", ignore = true)
    @Mapping(target = "modifyTime", ignore = true)
    @Mapping(target = "modifyBy", ignore = true)
    @Mapping(target = "createTime", ignore = true)
    @Mapping(target = "createBy", ignore = true)
    LotDef mapToLotDef(CreateLotDef def);

    List<LotAttrDef> mapToLotAttrDefList(List<LotAttr> lotAttrList);

}
